package com.itheima.ssm.service;

import co.ch.dao.ProductDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import qy.c.domain.Product;

import java.util.List;

@Controller
@RequestMapping("/product")
public class ProductController {
    @Autowired
    private ProductDao productDao;
    @RequestMapping("findall.do")
    public ModelAndView findAll() throws Exception {
        ModelAndView modelAndView =
                new ModelAndView();
        List<Product> all = productDao.findAll();
        ModelAndView ss_ = modelAndView.addObject("ss ", all);
//        modelAndView.setView(ss_);
        return modelAndView;
    }
}
